package controller

import (
	Log "hello/Log"
	"hello/logic"

	"github.com/gin-gonic/gin"
	_ "github.com/swaggo/gin-swagger"
	"go.uber.org/zap"
)

// @title community API
// @version 1.0
// @description 查询社区所有用户的账号

// @contact.name   xiangMaster
// @contact.name   FangMaster
// @contact.url	   https://gitee.com/masterxiang/summary-of-knowledge-points

// @license.name  Apache 2.0
// @license.url   http://www.apache.org/licenses/LICENSE-2.0.html

// @host      localhost:8090
// @BasePath  api/v1/community

func CommunityHandler(c *gin.Context) {
	//查询所有的社区
	data, err := logic.GetCommunityList()
	if err != nil {
		Log.Logger.Error("login CommunityHandler failed....", zap.Error(err))
		RespnseErr(c, CodeServerBusy)
		return
	}

	RespnseSuccess(c, data)
}
